package com.entity;

import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.annotations.Version;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author wty
 * @since 2022-01-04
 */
@Data
@Accessors(chain = true)
public class Node extends Model<Node> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 名字
     */
    private String name;
    /**
     * 父id
     */
    private Integer pid;
    /**
     * 优先级
     */
    private Integer priority;
    /**
     * 执行时间
     */
    @TableField("execute_time")
    private String executeTime;
    /**
     * 关联的卡片
     */
    @TableField("card_id")
    private String cardId;

    @TableField(exist = false)
    private List<Card> cardList=new ArrayList<>();

    @TableField(exist = false)
    private List<Node> childNode=new ArrayList<>();

    @TableField(exist = false)
    private List<TaskRecord> taskRecords=new ArrayList<>();

    @TableField(exist = false)
    private Map<String,TaskRecord> taskRecordMap=new HashMap<>();

    @TableField(exist = false)
    private List<Integer> dataList=new ArrayList<>();


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
